
TheEngine = 
{
    --The c++ Engine class
    engine = -1,
    --
    OpenFile =      function(path,fileName)
                        TheEngine.Print("Opening file...")
                        TheEngine.Print(fileName)
                        local result = TheEngine.engine:LOpenLuaFile(path,fileName)
                        if result  == false
                        then
                            TheEngine.Print("Opening...")
                            TheEngine.Print(fileName)
                            TheEngine.Print("Failed...")
                        else
                        TheEngine.Print("...Success! ")
                        end
                    end,

    Print =         function(string)
                        TheEngine.engine:PrintLuaMessage(string)
                    end,

    Initialize =    function()
                        TheEngine.OpenFile("../src/Scripts/","gamestate.lua")
                        TheEngine.engine:CreateWindowClass("Engine Testing")
                        --FS or no?
                        TheEngine.engine:CreateWindowObj("www.cb-games.co.uk", true,512,512)
                        --VS or no?
                        TheEngine.engine:CreateDevice(true)
                        TheEngine.engine:InitializeDepthSurface(2048,2048)
                        TheEngine.engine:InitializeInput()
                        TheEngine.engine:LoadAndSetDefaultTexture("Textures/", "floor.png")
                    end,

    ShutDown =      function()
                        TheEngine.engine:EndCurrentState()
                        TheEngine.engine:ReleaseResources()
                        TheEngine.engine:ShutDownInput()                        
                        TheEngine.engine:ReleaseLuaTables()                        
                        TheEngine.engine:LoseDevice()
                        TheEngine.engine:Unregister()
                    end,

    Start =         function(engine)
                        TheEngine.engine = engine
                        TheEngine.Print("Starting...")
                        TheEngine.Initialize()
                    end
}